﻿Imports System
Imports System.Collections.Generic
Imports System.Text
Imports System.Net
Imports System.IO


Public Class Form1

    Private Sub LinkLabel1_LinkClicked(ByVal sender As System.Object, ByVal e As System.Windows.Forms.LinkLabelLinkClickedEventArgs) Handles LinkLabel1.LinkClicked
        Process.Start("http://10.168.45.108/ynydsoft/zl/ynnog.rar")
    End Sub

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        Process.Start("conf.exe")
    End Sub

    Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
        Shell("mstsc.exe", AppWinStyle.NormalFocus)
    End Sub

    Private Sub LinkLabel2_LinkClicked(ByVal sender As System.Object, ByVal e As System.Windows.Forms.LinkLabelLinkClickedEventArgs) Handles LinkLabel2.LinkClicked
        Process.Start("http://10.168.45.108/ynydsoft/zl/qudong.rar")
    End Sub

    Private Sub LinkLabel3_LinkClicked(ByVal sender As System.Object, ByVal e As System.Windows.Forms.LinkLabelLinkClickedEventArgs) Handles LinkLabel3.LinkClicked
        Process.Start("http://10.168.45.108/ynydsoft/zl/chajian.rar")
    End Sub
    Private Sub LinkLabel5_LinkClicked(ByVal sender As System.Object, ByVal e As System.Windows.Forms.LinkLabelLinkClickedEventArgs) Handles LinkLabel5.LinkClicked
        Process.Start("http://10.168.45.108/ynydsoft/zl/ynnog.zip")
    End Sub

    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        'Dim path As String = "http://10.168.45.108/ynydsoft/zl/*.sn"
        'Label5.Text = System.IO.Path.GetFileName(path)
        'Dim myReq As HttpWebRequest = WebRequest.Create("http://10.168.45.108/ynydsoft/zl/*.sn")
        'Dim path As String = System.Web.Current.Server.MapPath(SavePath)
        'Dim zl As New System.Net.WebClient() '指定用户名和密码 
        'zl.Credentials = New System.Net.NetworkCredential("zl", "cake239") '从FTP服务器下载 
        'Dim path As String = System.IO.Path.GetDirectoryName(Application.ExecutablePath)
        ''zl.DownloadFile("ftp://10.168.45.108/*.sn", path & "\test.txt")
        'zl.DownloadFile("http://10.168.45.108/ynydsoft/zl/*.sn", path)
        'Dim path = "http://10.168.45.108/ynydsoft/zl/"
        'Dim ext = System.IO.Path.GetExtension(path)
        'Dim pathname = System.IO.Path.GetFileName(path)
        'Label5.Text = pathname

        'Dim a As String = "http://10.168.45.108/ynydsoft/zl/"
        'For Each ws In My.Computer.FileSystem.GetFiles(a)
        '    Dim kzm As String = ws.Substring(InStrRev(ws, "."), ws.Length - InStrRev(ws, ".")) '定义扩展名变量
        '    If kzm = "sn" Or kzm = ".sn" Then '定要注意扩展名写avi<>AVI
        '        Label5.Text = ws
        '    End If
        'Next
        
        'Dim myClient As New Net.WebClient()
        'myClient.DownloadFile("http://10.168.45.108/ynydsoft/zl/1.sn", "1.sn")
        'Label5.Text = *



        'Label5.Text = Dir("http://10.168.45.108/ynydsoft/zl/*.sn", vbHidden)
        Label5.Text = System.IO.Path.GetFileName("20161208")
        ''Label5.Text = My.Computer.FileSystem.GetName(http://10.168.45.108/ynydsoft/zl/*.sn)
    End Sub

    Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
        Process.Start("http://10.168.45.108/ynydsoft/zl/TeamViewer.rar")
    End Sub

    Private Sub Label5_Click(ByVal sender As Object, ByVal e As EventArgs) Handles Label5.Click

    End Sub

    Private Sub LinkLabel8_LinkClicked(ByVal sender As Object, ByVal e As LinkLabelLinkClickedEventArgs) Handles LinkLabel8.LinkClicked
        Process.Start("http://10.168.45.108/ynydsoft/zl/setup.zip")
    End Sub

    Private Sub LinkLabel6_LinkClicked(ByVal sender As Object, ByVal e As LinkLabelLinkClickedEventArgs) Handles LinkLabel6.LinkClicked
        Process.Start("http://10.168.45.108/ynydsoft/zl/qudong.zip")
    End Sub

    Private Sub LinkLabel7_LinkClicked(ByVal sender As Object, ByVal e As LinkLabelLinkClickedEventArgs) Handles LinkLabel7.LinkClicked
        Process.Start("http://10.168.45.108/ynydsoft/zl/chajian.zip")
    End Sub

    Private Sub LinkLabel4_LinkClicked(ByVal sender As Object, ByVal e As LinkLabelLinkClickedEventArgs) Handles LinkLabel4.LinkClicked
        Process.Start("http://10.168.45.108/ynydsoft/zl/setup.rar")
    End Sub

    Private Sub ToolTip1_Popup(ByVal sender As Object, ByVal e As PopupEventArgs) Handles ToolTip1.Popup

    End Sub
End Class
